import type { App } from 'vue'
import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router"
import Home from '../views/home/index.vue'

// 路由项扩展
export type AppRouteRecordRaw = RouteRecordRaw & {
  hidden?: boolean
}

// 首页
export const HOME_PAGE = '/dashboard/Console'

const routes = [
  {
    path: '/',
    component: Home,
    meta: {
      title: '首页'
    }
  }
] as AppRouteRecordRaw[]

export const router = createRouter({
  history: createWebHashHistory(),
  routes: routes
})

export function initRouter(app: App<Element>) {
  app.use(router)
}